package vn.gg.network;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

/**
 * 
 * @author truongps
 *
 */
public class ServerCodecFactory implements ProtocolCodecFactory {

	ProtocolDecoder decoder;
	ProtocolEncoder encoder;
	
	public ServerCodecFactory() {
		decoder = new ServerDecoder();
		encoder = new ServerEncoder();
	}

	@Override
	public ProtocolDecoder getDecoder(IoSession arg0) throws Exception {
		return decoder;
	}

	@Override
	public ProtocolEncoder getEncoder(IoSession arg0) throws Exception {
		return encoder;
	}

}
